local rolely_xiuluo = fk.CreateSkill {
    name = "rolely_xiuluo",
    anim_type = "offensive",
    tags = { Skill.Compulsory }
}
Fk:loadTranslationTable {
    ["rolely_xiuluo"] = "修罗",
    [":rolely_xiuluo"] = "锁定技，当你受到其他角色造成的伤害后，若你的体力上限大于5，且体力值不足上限的一半，你将体力上限减至体力值，摸减少体力上限等量的牌，" ..
        "立刻获得一个额外的回合；当你杀死一名角色时，增加一点体力上限；你的手牌上限始终为12。",

    ["$rolely_xiuluo1"] = "百战轮回锻神躯，我以修罗怔天魔！",
    ["$rolely_xiuluo2"] = "六道何须论因果，独霸炼狱斩阎罗！",
}
rolely_xiuluo:addEffect(fk.Damaged, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(rolely_xiuluo.name) and player.hp < (player.maxHp / 2) and
            not player.dead and data.from and data.from ~= player and player.maxHp > 5
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local x = (player.maxHp - player.hp)
        room:changeMaxHp(player, -x)
        player:drawCards(x, rolely_xiuluo.name)
        data.from:endCurrentPhase()
        player:gainAnExtraTurn(false, rolely_xiuluo.name)
    end
})
rolely_xiuluo:addEffect(fk.Deathed, {
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(rolely_xiuluo.name) and data.killer == player
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:changeMaxHp(player, 1)
    end,
})

rolely_xiuluo:addEffect("maxcards", {
    fixed_func = function(self, player)
        if player:hasSkill(rolely_xiuluo.name) then
            return 12
        end
    end,
})
return rolely_xiuluo
